/*
 * D.cpp
 *
 *  Created on: 2012-5-30
 *      Author: ncrd
 */


#include <cstdio>
#include <cstring>

int main (void) {
	char str[110], ch;
	scanf("%s", str);
	bool isJava;
	int i, len = strlen(str);
	if (str[0] == '_' || str[len-1] == '_' || (str[0] >= 'A' && str[0] <= 'Z')) {
		printf("Error!\n");
		return 0;
	}

	for (i=0; i<len; i++) {
		if (str[i] == '_') {
			isJava = false;
			break;
		} else if(str[i] >= 'A' && str[i] <= 'Z') {
			isJava = true;
			break;
		}
	}
	while (i<len) {
		if ((isJava == true && str[i] == '_') ||
			(isJava == false && str[i] >= 'A' && str[i] <= 'Z')){
			printf("Error!\n");
			return 0;
		}
		i++;
	}
 	for (i=0; i<len; i++) {
		if (str[i] >= 'A' && str[i] <= 'Z') {
			printf("_%c", str[i] - 'A' + 'a');
		} else if (str[i] == '_') {
			i++;
			printf("%c", str[i] - 'a' + 'A');
		} else
			printf("%c", str[i]);
	}
	printf("\n");
}
